
package org.come.Frame;

import com.tool.tcpimg.UIUtils;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
import javax.swing.BorderFactory;
import javax.swing.JComponent;
import javax.swing.JInternalFrame;
import javax.swing.plaf.basic.BasicInternalFrameUI;
import org.come.Jpanel.NPCJpanel;
import org.come.until.FormsManagement;
import org.come.until.MessagrFlagUntil;
import org.come.until.Music;
import org.come.until.ScrenceUntil;

public class NPCJfram extends JInternalFrame implements MouseListener {
    private NPCJpanel npcjpanel = new NPCJpanel();

    public static NPCJfram getNpcJfram() {
        return (NPCJfram)FormsManagement.getInternalForm(27).getFrame();
    }

    public NPCJfram() {
        this.setBorder(BorderFactory.createEmptyBorder());
        ((BasicInternalFrameUI)this.getUI()).setNorthPane(null);
        this.add(this.npcjpanel);
        this.setBounds(ScrenceUntil.Screen_x / 2 - 267, 200, 534, 208);
        this.pack();
        this.setBackground(UIUtils.Color_BACK);
        this.setVisible(false);
        this.addMouseListener(this);
        this.setDefaultCloseOperation(2);
    }

    public NPCJpanel getNpcjpanel() {
        return this.npcjpanel;
    }

    public void setNpcjpanel(NPCJpanel npcjpanel) {
        this.npcjpanel = npcjpanel;
    }

    @Override
    public void mouseClicked(MouseEvent e) {
        if (MessagrFlagUntil.ImgFlagImg.equals(MessagrFlagUntil.MOUSE13)) {
            MessagrFlagUntil.setMouse(MessagrFlagUntil.MOUSE1);
        }
    }

    @Override
    public void mousePressed(MouseEvent e) {
        Music.addyinxiao("关闭窗口.mp3");
        if (e.isMetaDown()) {
            FormsManagement.HideForm(27);
        } else {
            FormsManagement.Switchinglevel(27);
        }

    }

    @Override
    public void mouseReleased(MouseEvent e) {
    }

    @Override
    public void mouseEntered(MouseEvent e) {
    }

    @Override
    public void mouseExited(MouseEvent e) {
    }
}
